<template>
  <div class="a">
    <h2>A 组件</h2>
    <button @click="emitB">派发一个事件</button>
  </div>
</template>

<script setup lang="ts">
import Bus from "./Bus";

let flag = false;

const emitB = () => {
  flag = !flag;
  Bus.emit("on-click", flag);
};
</script>

<style scoped>
.a {
  width: 100%;
  height: 100px;
  background-color: red;
  margin-top: 10px;
}
</style>
